<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="pt-br">
<head>
  <meta charset="iso-8859-1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Login de acesso</title>
  <link rel="stylesheet" href="estiloFormLogin.css">
  <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
    <%   HttpSession sessao = request.getSession(true);
    if (sessao.getAttribute("loginAgenda")!=null) {
    %>
        <jsp:forward page="home.jsp"></jsp:forward>
    <% 
    }else{ %>
        <section class="formulario">
          <div class="login">
            <h1>Agenda de Compromissos</h1>
            <% if (request.getAttribute("erro")!=null) {%>      
            <h2><%= request.getAttribute("erro") %></h2>
            <%}%> 
            <% if (request.getParameter("cadastro_efetuado")!=null) {%>      
            <h2><%= request.getParameter("cadastro_efetuado") %></h2>
            <%}%> 
            <form method="post" action="ServletLogin?pagina=home.jsp">
              <p><input type="text" name="login" placeholder="Nome de usu&aacute;rio"></p>
              <p><input type="password" name="password" placeholder="Senha"></p>
              <p class="botao"><input type="submit" name="btLogin" value="Login">
              <p>Não é cadastrado? <a href="adicionaUsuario.jsp">Clique aqui!</a></p>
            </form>
          </div>
        </section>
    <%} %>
</body>
</html>